package com.djahva.image;

import java.io.File;

public class CachedObject {

	private File file;
	private long lastAccess;
	private long procesTime; //totale tijd nodig voor opvragen zonder cache
	private int accessCount;
	
	public CachedObject(File file,long lastAccess, long procesTime){
		this.file = file;
		this.accessCount = 0;
		this.lastAccess = lastAccess;
		this.procesTime = procesTime;
	}
	
	public File getFile(){
		return this.file;
	}
	
	public int getAccessCount(){
		return this.accessCount;
	}
	
	public void objectAccessed(){
		this.accessCount++;
		this.lastAccess = System.currentTimeMillis();
	}
	
	public long getLastAccess(){
		return this.lastAccess;
	}
	
	public long getProcesTime(){
		return this.procesTime;
	}
	
	public void deleteFile(){
		file.delete();
	}
}
